<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="templates/padraoUser.xhtml">
	<ui:define name="conteudo">
	    <h:form id="cliente">
			<p:panel header="Cadastro"  >
				<h:panelGrid id="grid" columns="2" style="margin-bottom:10px" >
					<f:facet name="header">
						<p:messages />
					</f:facet>

					<h:outputLabel for="nome" value="Nome: *" />
					<p:inputText id="nome" value="#{clienteBean.cliente.nome}"	required="true" requiredMessage="Nome é Requerido."/>

					<h:outputLabel for="cpf" value="CPF: *" />
					<p:inputMask id="cpf" value="#{clienteBean.cliente.cpf}"	required="true" requiredMessage="CPF é Requeiro." mask="999.999.999-99"/>
					
					<h:outputLabel for="sexo" value="Sexo: *" />
					<p:selectOneRadio id="sexo" value="#{clienteBean.cliente.sexo}"	required="true" requiredMessage="Sexo é Requerido." >  
            			<f:selectItem itemLabel="Feminino" itemValue="F" />  
            			<f:selectItem itemLabel="Masculino" itemValue="M" />  
        			</p:selectOneRadio> 
        			
        			<h:outputLabel for="email" value="e-mail: *" />
					<p:inputText id="email" value="#{clienteBean.cliente.email}"	required="true" requiredMessage="E-mail é Requerido." />
        			
        			<h:outputLabel for="senha" value="Senha: *" />
					<p:password id="senha" value="#{clienteBean.cliente.senha}"	required="true" requiredMessage="Senha é Requerido." />
        			
					<h:outputLabel for="data" value="Data de Nasc: *" />
					<p:calendar effect="slide" value="#{clienteBean.cliente.nasc}" id="date" required="true" requiredMessage="Data de Nascimento é Requerido" maxlength="8" pattern="dd/MM/yyyy" locale="pt_BR"/>              		 
            	
					<h:outputLabel for="end" value="Endereço: *" />
					<p:inputText id="end" value="#{clienteBean.cliente.endereco}"	required="true" requiredMessage="Endereço é Requerido." />
					
					<h:outputLabel for="tel" value="Telefone: *" />
					<p:inputMask  id="tel" value="#{clienteBean.cliente.tel1}"	required="true" requiredMessage="Telefone é Requerido." mask="(99) 9999-9999"/>
					
					<h:outputLabel for="cel" value="Cell: *" />
					<p:inputMask  id="cel" value="#{clienteBean.cliente.tel2}"	required="true" requiredMessage="Celular é Requerido." mask="(99) 9999-9999"/>
					
				</h:panelGrid>
			</p:panel>

			<h:panelGrid columns="6" cellpadding="5">
				<p:commandButton value="Enviar" id="btnOk" process="@all"
					update="grid" action="#{clienteBean.salvar}" ajax="false"/>
					
				<p:commandButton value="Vaii dhiabo" id="envia" process="@all"
					update="grid" action="#{clienteBean.salvar}" />	
			</h:panelGrid>

		</h:form>
		
	</ui:define>
</ui:composition>
</html>